{% include file="index.header.tpl.php" %}
{% include file="index.left.tpl.php" %}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form name="myform" action="" method="get">
                <div class="box-header with-border">
                    <a href="index.php?a=personnel.list&appoint_type=1&appoint_staff={%$appoint_staff%}" class="btn btn-default">部门任命列表</a>
                    
                    <a href="index.php?a=personnel.list&appoint_type=3&appoint_staff={%$appoint_staff%}" class="btn btn-default">级长任命列表</a>
                    <a href="index.php?a=personnel.list&appoint_type=4&appoint_staff={%$appoint_staff%}" class="btn btn-default">班主任任命列表</a>			
					<a href="index.php?a=personnel.list&appoint_type=2&appoint_staff={%$appoint_staff%}" class="btn btn-default">教研组任命列表</a>
					<a href="index.php?a=personnel.list&appoint_type=5&appoint_staff={%$appoint_staff%}" class="btn btn-primary">备课组任命列表</a>
					<a href="index.php?a=personnel.list&appoint_type=6&appoint_staff={%$appoint_staff%}" class="btn btn-default">学科组任命列表</a>
                    <a href="index.php?a=personnel.out&appoint_type=5&appoint_staff={%$appoint_staff%}" target="_blank" class="btn btn-warning btn-sm" style="float:right; color:#fff; margin-left:10px;">导 出</a>
					<a href="index.php?a=personnel.add&appoint_type={%$appoint_type%}&appoint_staff={%$appoint_staff%}" class="btn btn-primary btn-sm" style="float:right; color:#fff;">新 增</a>
                </div>
                <div class="box-body">
				    <div class="col-md-3 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   备课组：
						  </label>
						  <div class="input-group col-md-8 col-xs-12">
							  <select class="form-control" name="prepare_id">
                                <option value=""> 全部</option>
								{%foreach from=$prepare_lists key=key item=value%}
                                <option value="{%$value.prepare_id%}"{%if $value.prepare_id == $prepare_id%}selected{%/if%}>{%$value.prepare_name%}</option>
                                {%/foreach%}
                              </select> 
						  </div> 
				    </div>
					<div class="col-md-3 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   职务：
						  </label>
						  <div class="input-group col-md-8 col-xs-12">
							  <select class="form-control" name="position_type">
							    <option value="">全部</option>
                                <option value="3"{%if $position_type == 3%}selected{%/if%}>组长</option>
								<option value="4"{%if $position_type == 4%}selected{%/if%}>副组长</option> 
                               </select>
						  </div> 
				    </div>
					<div class="col-md-3 col-xs-12 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; ">
							   人员：
						  </label>
						  <div class="input-group col-md-8 col-xs-12" style="float:left;">
							   <input type="text" class="form-control" name="staff_name" value="{%$staff_name%}">
						  </div>						  
				    </div>
					<div class="col-md-1 col-xs-12">
					   <input type="hidden" name="a" value="personnel.list">
					   <input type="hidden" name="appoint_staff" value="{%$appoint_staff%}">
					   <input type="hidden" name="appoint_type" value="{%$appoint_type%}">
					   <button type="submit" class="btn btn-warning">查 询</button>
					</div>
					<div style="clear:both; height:4px;"></div>
                     <table class="table table-bordered table-striped"  id="mytable">
                                <thead>
                                    <tr style="background-color:#a273ff;">
                                        <td>学科组</td>
                                        <td>职务</td>
										<td>姓名</td>
                                        <td width="150">操作</td>
                                    </tr>	
                                </thead>

                                <tbody>
								{%foreach from=$appoint_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.prepare_name%}</td>
										<td>{%$value.position_type%}</td>
										<td>{%$value.staff_name%}</td>
                                        <td>
                                        	 <a href="index.php?a=personnel.update&appoint_id={%$value.appoint_id%}&appoint_type={%$appoint_type%}&appoint_staff={%$appoint_staff%}" class="btn btn-warning btn-sm" title="修改" > <i class="fa fa-edit (alias)"></i></a>
											  <a href="index.php?a=personnel.del&appoint_id={%$value.appoint_id%}&appoint_type={%$appoint_type%}" class="btn btn-danger btn-sm" onclick="if(confirm('警告！确认删除信息?')==false)return false;"> <i class="fa fa-trash"></i></a>
                                        </td>
                                    </tr>
								{%/foreach%}      
                            </tbody>
                        </table>
				   </div><!--box-body -->
				   <div class="box-footer">
				   {%$page%}
				   </div>
               </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{% include file="index.footer.tpl.php" %}
<!-- 二级联动 -->
<script type="text/javascript">
        $(document).ready(function () {
            $("#grade_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=student.gradelistjson",
			type:"get",
			data: "grade_id=" + $("#grade_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
                            //实例2个字符串变量来拼接下拉列表
                            var industr = "";
                            //使用jquery解析json中的数据
                            $.each(msg, function (n, value) {
                                industr += ("<option value=\"" + value.class_id + "\">" + value.class_name);
                                industr += ("</option>");
                            });

                            $("#class_id").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>

